<template>
  <div class="efficiency-container">
    <div class="efficiency-top">
      <el-row :gutter="20">
        <el-col :span="12">
          <div class="top-left top">
            <div class="top-left-title title">运营人员（当天）</div>
            <div class="top-left-body body">
              <div class="top-left-body-item item">
                <span class="num">{{ yunying.total }}</span>
                <span class="name-title">工单总数（个）</span>
              </div>
              <div class="top-left-body-item item">
                <span class="num">{{ yunying.completedTotal }}</span>
                <span class="name-title">完成工单（个）</span>
              </div>
              <div class="top-left-body-item item">
                <span class="num">{{ yunying.cancelTotal }}</span>
                <span class="name-title">拒绝工单（个）</span>
              </div>
              <div class="top-left-body-item item">
                <span class="num">{{ yunying.workerCount }}</span>
                <span class="name-title">运营人员数（个）</span>
              </div>
            </div>
          </div>
        </el-col>
        <el-col
          :span="12"
        ><div class="top-right top">
          <div class="top-right-title title">运维人员（当天）</div>
          <div class="top-right-body body">
            <div class="top-right-body-item item">
              <span class="num">{{ yunying.total }}</span>
              <span class="name-title">工单总数（个）</span>
            </div>
            <div class="top-right-body-item item">
              <span class="num">{{ yunwei.completedTotal }}</span>
              <span class="name-title">完成工单（个）</span>
            </div>
            <div class="top-right-body-item item">
              <span class="num">{{ yunwei.cancelTotal }}</span>
              <span class="name-title">拒绝工单（个）</span>
            </div>
            <div class="top-right-body-item item">
              <span class="num">{{ yunwei.workerCount }}</span>
              <span class="name-title">运营人员数（个）</span>
            </div>
          </div>
        </div></el-col>
      </el-row>
    </div>
    <div class="efficiency-bottom">
      <el-row :gutter="20">
        <el-col :span="18"><div class="bottom-left">
          <div class="bottom-left-header">
            <span>工单状态</span>
            <el-date-picker
              v-model="value2"
              type="daterange"
              align="right"
              unlink-panels
              range-separator="~"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            />

          </div>
        </div></el-col>
        <el-col :span="6"><div class="bottom-right">
          <span>人效排行（月度）</span>
          <el-select v-model="value" placeholder="请选择">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </div></el-col>
      </el-row>
    </div>
  </div>
</template>
<script>
import dayjs from 'dayjs'
import { getTaskReportInfoRequest } from '../../api/people.js'
export default {
  name: '',
  data() {
    return {
      start: '',
      end: '',
      yunying: {},
      yunwei: {},
      value2: '',
      options: [{
        value: '选项1',
        label: '黄金糕'
      }, {
        value: '选项2',
        label: '双皮奶'
      }, {
        value: '选项3',
        label: '蚵仔煎'
      }, {
        value: '选项4',
        label: '龙须面'
      }, {
        value: '选项5',
        label: '北京烤鸭'
      }],
      value: ''
    }
  },
  computed: {
  },
  created() {
    this.getTaskReportInfo()
  },
  methods: {
    async getTaskReportInfo() {
      const currentDate = dayjs().format('YYYY-MM-DD HH:mm:ss')
      this.start = dayjs(new Date().getTime() - (24 * 60 * 60 * 1000)).format('YYYY-MM-DD HH:mm:ss')
      console.log(this.start, 8989)
      this.end = currentDate
      const res = await getTaskReportInfoRequest(this.start, this.end)
      console.log(res, 4545)
      this.yunying = res.data[0]
      this.yunwei = res.data[1]
    }
  }
}
</script>
<style lang='scss'  scoped>
.efficiency-top {
  margin-bottom: 20px;
}
.top {
  padding: 20px;
  background-color: pink;
  height: 166px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;

  .title {
    font-size: 16px;
    color: #333;
    height: 20px;
  }

  .body {
    display: flex;
    flex: 1;
    justify-content: space-around;
    align-items: center;

    .item {
      float: 1;
      display: flex;
      flex-direction: column;

      .num {
        font-size: 36px;
        margin-bottom: 8px;
      }
      .name-title {
        font-size: 12px;
      }
    }
  }
}

.top-left-body-item {
  .num {
    color: #0e1f6f;
    font-weight: bold;
  }

  .name-title {
    color: #9caddb;
    font-size: 12px;
  }
}

.top-right-body-item {
  .num {
    color: #ec635e;
    font-weight: bold;
  }

  .name-title {
    color: #d49992;
    font-size: 12px;
  }
}

.bottom-left {
  padding: 20px;
  background-color: pink;
  height: 542px;
  border-radius: 20px;
}

.bottom-right {
  padding: 20px;
  background-color: pink;
  height: 542px;
  border-radius: 20px;
}
</style>
